package com.yanqu.road.entity.activity.huashigang;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.player.UserBaseInfo;

/**
 * @Author wpj
 * @Date 2020/10/4
 */
@FieldTypeAnnotation(tableName = "t_c_huashigang_treasure")
public class HuaShiGangTreasure extends DataObject {

    @FieldTypeAnnotation(select = true, update = true)
    int activityId;
    // x-y
    @FieldTypeAnnotation(update = true, desc = "坐标")
    String pointKey = "";

    @FieldTypeAnnotation(update = true, desc = "藏宝id")
    int treasureId;

    @FieldTypeAnnotation(desc = "是否好奖励")
    boolean goodReward;

    @FieldTypeAnnotation(desc = "奖励")
    String reward = "";

    @FieldTypeAnnotation(desc = "开启人信息")
    UserBaseInfo openPlayer = new UserBaseInfo();

    @FieldTypeAnnotation(desc = "开启时间")
    long openTime;


    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }

    }
    public void setPointKey(String pointKey) {
        if(null == pointKey){
            return;
        }
        if(!this.pointKey.equals(pointKey)) {
            this.pointKey = pointKey;
            setOp(DataStatus.Update);
        }
    } public void setTreasureId(int treasureId) {
        if (this.treasureId != treasureId) {
            this.treasureId = treasureId;
            setOp(DataStatus.Update);
        }

    }
    public void setGoodReward(boolean goodReward) {
        if (this.goodReward != goodReward) {
            this.goodReward = goodReward;
            setOp(DataStatus.Update);
        }

    }
    public void setReward(String reward) {
        if(null == reward){
            return;
        }
        if(!this.reward.equals(reward)) {
            this.reward = reward;
            setOp(DataStatus.Update);
        }
    } public void setOpenTime(long openTime) {
        if (this.openTime != openTime) {
            this.openTime = openTime;
            setOp(DataStatus.Update);
        }

    }

    public void setOpenPlayer(UserBaseInfo openPlayer) {
        this.openPlayer = openPlayer;
        setUpdateOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public String getPointKey() {
        return pointKey;
    }

    public int getTreasureId() {
        return treasureId;
    }

    public boolean isGoodReward() {
        return goodReward;
    }

    public String getReward() {
        return reward;
    }

    public UserBaseInfo getOpenPlayer() {
        return openPlayer;
    }

    public long getOpenTime() {
        return openTime;
    }

    public void setOpenPlayerNotUpdate(UserBaseInfo openPlayer) {
        this.openPlayer = openPlayer;
    }

}
